﻿using AbpVnext_Module.Dto;
//using AbpVnext_Module.Dto.Order;
using AbpVnext_Module.Model;
using AutoMapper;

namespace AbpVnext_Module
{
    public class ProjectProfile : Profile
    {
        public ProjectProfile()
        {
            //dto和商品模型之间的映射  //配置子类映射
            CreateMap<ProductImage, ProductImageDto>().ForMember(dist => dist.ProductImageOrders,opt => opt.MapFrom(src => src.ProductImageOrders));
            CreateMap<ProductImageDto, ProductImage>();
            ////配置子类映射
            CreateMap<ProductImageCreateDto, ProductImage>().ForMember(dist => dist.ProductImageOrders, opt => opt.MapFrom(src => src.ProductImageOrders));
            ////配置子类映射
            CreateMap<ProductImageUpdateDto, ProductImage>().ForMember(dist => dist.ProductImageOrders, opt => opt.MapFrom(src => src.ProductImageOrders));

            //imageOrderDto
            CreateMap<ProductImageOrderDto, ProductImageOrder>();
            CreateMap<ProductImageOrder, ProductImageOrderDto>();

            ////order
            //CreateMap<Order, OrderDto>();
            //CreateMap<OrderDto, Order>();
            //CreateMap<OrderCreateDto, Order>();
            //CreateMap<OrderUpdateDto, Order>();
            //CreateMap<Order, OderPageResultDto>();

            //CreateMap<Order, OrderCreateResultDto>();
            //CreateMap<Order, OrderUpdateResultDto>();

            //Permission
            CreateMap<PermissionProduct, PermissionDto>();
            CreateMap<PermissionDto, PermissionProduct>();
            CreateMap<PermissionCreateDto, PermissionProduct>();
            CreateMap<PermissionUpdateDto, PermissionProduct>();
            CreateMap<PermissionProduct, PermissionPageResultDto>();
            CreateMap<PermissionProduct, PermissionCreateResultDto>();
            CreateMap<PermissionProduct, PermissionUpdateResultDto>();

            //PermissionGrantss 配置映射
            CreateMap<PermissionGrants, PermissionGrantsDto>();
            CreateMap<PermissionGrantsDto, PermissionGrants>();
            CreateMap<PermissionGrantsCreateDto, PermissionGrants>();
            CreateMap<PermissionGrantsUpdateDto, PermissionGrants>();
            CreateMap<PermissionGrants, PermissionGrantsPageResultDto>();

            CreateMap<PermissionGrants, PermissionGrantsCreateResultDto>();
            CreateMap<PermissionGrants, PermissionGrantsUpdateResultDto>();
        }
    }
}
